package com.aruba.paging4.entity;

import androidx.room.Entity;
import androidx.room.PrimaryKey;

import java.util.Objects;

/**
 * Created by aruba on 2021/9/17.
 */
@Entity
public class Movie {
    //作为本地表的主键
    @PrimaryKey(autoGenerate = true)
    public int key;
    //唯一id
    public int id;
    //标题
    public String title;
    //图片地址
    public String cover;
    //评分
    public String rate;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Movie movie = (Movie) o;
        return id == movie.id && title.equals(movie.title) && cover.equals(movie.cover) && rate.equals(movie.rate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, id, title, cover, rate);
    }
}
